Folium Demo¶
Introducing the geonexus Python package for interactive mapping
Uncomment the following line to install geonexus if needed.
In [1]:
Copied!
# !pip install geonexus
# !pip install geonexus
geonexus has two plotting backends: folium, and ipyleaflet. Note that the backends do not offer equal functionality. Some interactive functionality in geonexus might not be available in other plotting backends. To use a specific plotting backend, use one of the following:
import geonexus.geonexus as geonexusimport geonexus.foliumap as geonexus
In [2]:
Copied!
import geonexus.foliumap as geonexus
import geonexus.foliumap as geonexus
Create an interactive map.
In [3]:
Copied!
m = geonexus.Map()
m
m = geonexus.Map()
m
Out[3]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Importing a geojson file and specify the default map center (Niger) and zoom level.
In [4]:
Copied!
m = geonexus.Map(center=[17.6078, 8.0817], zoom=6)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
m.add_geojson(url, name="countries")
m.add_layer_control()
m
m = geonexus.Map(center=[17.6078, 8.0817], zoom=6)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
m.add_geojson(url, name="countries")
m.add_layer_control()
m
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Importing a geojson file and specify the default map center (World) and zoom level.
In [5]:
Copied!
m = geonexus.Map(center=[20, 0], zoom=2)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
m.add_geojson(url, name="countries")
m.add_layer_control()
m
m = geonexus.Map(center=[20, 0], zoom=2)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
m.add_geojson(url, name="countries")
m.add_layer_control()
m
Out[5]:
Make this Notebook Trusted to load map: File -> Trust Notebook